﻿using GameView.Comment;
using GameView.Models;
using GameView.Services.Dtos.Blacklist;

namespace GameView.Services
{
    public class CommandService
    {
        public async Task<ApiResponse<List<CommandShowModel>>> GetListAsync(string nameEn)
        {
            var res = await $"{APIHelper.Command}/list-by-name-en/{nameEn}".GetAsync<List<CommandShowModel>, object>();
            return res;
        }

        public async Task<ApiResponse<int>> BatchDelete(List<int> ids)
        {
            var res = await $"{APIHelper.Command}/batch-delete".DeleteData<List<int>>(ids);
            return res;
        }

        public async Task<ApiResponse<CommandShowModel>> Add(CommandAddDto queryDto)
        {
            var res = await $"{APIHelper.Command}".AddNewAsync<CommandAddDto, CommandShowModel>(queryDto);
            return res;
        }

        public async Task<ApiResponse<CommandShowModel>> Edit(CommandEditDto queryDto)
        {
            var res = await $"{APIHelper.Command}/edit".PutAsync<CommandShowModel, CommandEditDto>(queryDto);
            return res;
        }
    }
}